import axios from 'axios'

const service = axios.create({
    baseURL: 'http://127.0.0.1:9070/api',
    timeout: 5000
});


service.interceptors.response.use(
    response => {
        const res = response.data;
        if (res.code !== 0) {
            return Promise.reject(new Error(res.msg));
        } else {
            return res.data;
        }
    }, error => {
        return Promise.reject(error);
    }
);

export default service

